<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

Route::get('think', function () {
    return 'hello,ThinkPHP6!';
});

Route::get('hello/:name', 'index/hello');

Route::get('test','index/test');


Route::group('v1',function (){
    //登入
    Route::post('/login','LoginController/login');

    //需要登入的接口
    Route::group('',function (){

        Route::get('/findAlbum','AlbumController/findAlbum');         //查找相册
        Route::get('/findPhoto','AlbumController/findPhoto');         //查找照片
        Route::post('addPhoto','AlbumController/addPhoto');           //添加照片

        Route::post('/post', 'PostController/insertPosts');                              //添加帖子
        Route::post('/postimg', 'PostController/insertPostsImg');                        //添加帖子的图片
        Route::get('/getUserPosts', 'PostController/getUserPosts');                      //查询论坛列表
        Route::get('/getDetailsPosts', 'PostController/getDetailsPosts');                //首页论坛详情
        Route::get('/getComments', 'PostController/getComments');                        //详情页评论查询
        Route::get('/getNumberComments', 'PostController/getNumberComments');            //详情页评论量查询
        Route::put('/updateLikePosts', 'PostController/updateLikePosts');                //帖子点赞
        Route::put('/updateNotlikePosts', 'PostController/updateNotlikePosts');          //帖子取消点赞
        Route::post('/insertComments', 'PostController/insertComments');                 //详情页评论新增
        Route::put('/updateCollectionPosts', 'PostController/updateCollectionPosts');    //帖子收藏
        Route::get('/searchPosts', 'PostController/searchPosts');                        //帖子搜索

        Route::get('/getUserinfo', 'UserController/getUser');         //获取用户信息
        Route::put('/headImg', 'UserController/updateHeadImg');       //修改头像
        Route::put('/BgImg', 'UserController/updateBgImg');           //修改背景
        Route::put('/user', 'UserController/updateUser');             //修改用户信息
        Route::put('/userPwd', 'UserController/updatePassword');      //修改密码
        Route::get('/getPost','UserController/getPost');              //获取帖子
        Route::get('/getPostLike','UserController/getPostsLike');     //获取收藏夹
        Route::put('/unCollect','/UserController/unCollection');      //取消收藏
        Route::delete('/droPost','/UserController/droPost');          //删除帖子

        Route::get('/getClassInfo','ClassInfoController/getClassInfo');  //查找班级信息
        Route::get('/getClassPhoto','ClassInfoController/getClassPhoto');//查找班级图片
        Route::PUT('/putClassInfo','ClassInfoController/putClassInfo');  //修改班级信息
        Route::PUT('/putClassPhoto','ClassInfoController/putClassPhoto'); //修改班级图片

        Route::get('/onlineChat','onlineChatController/chat');        //查找聊天信息
        Route::get('/noRead','onlineChatController/chat_look');       //查找未读信息数量

        Route::get('/getStudentInfo','StudentInfoController/getStudentInfo');           //查找学生信息
        Route::put('/putStudentInfo','StudentInfoController/putStudentInfo');           //修改学生信息
        Route::post('/postStudentInfo','StudentInfoController/postStudentInfo');        //添加学生信息
        Route::post('/importData','StudentInfoController/importData');                  //批量添加学生信息
        Route::delete('/deleteStudentInfo','StudentInfoController/deleteStudentInfo');  //删除学生信息


        Route::get('getNotice','ClassInfoController/getNotice');            //获取公告
        Route::delete('deleteNotice','ClassInfoController/deleteNotice');   //删除公告
        Route::post('addNotice','ClassInfoController/addNotice');           //新增公告

    })->middleware(\app\middleware\Check::class);
});

Route::post('token','LoginController/token');